Skip to content

Conversation

@usx95
Copy link
Contributor

@usx95 usx95 commented Jan 8, 2025

@usx95 usx95 requested a review from hokein January 8, 2025 13:42
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Jan 8, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 8, 2025

@llvm/pr-subscribers-clang

Author: Utkarsh Saxena (usx95)

Changes

Useful for maps: https://en.cppreference.com/w/cpp/container/map/insert_or_assign


Full diff: https://github.com/llvm/llvm-project/pull/122109.diff

1 Files Affected:

  • (modified) clang/lib/Sema/SemaAttr.cpp (+2-2)
diff --git a/clang/lib/Sema/SemaAttr.cpp b/clang/lib/Sema/SemaAttr.cpp
index 44485e71d57a01..42aa68d2905c03 100644
--- a/clang/lib/Sema/SemaAttr.cpp
+++ b/clang/lib/Sema/SemaAttr.cpp
@@ -307,8 +307,8 @@ void Sema::inferLifetimeCaptureByAttribute(FunctionDecl *FD) {
       Annotate(MD);
     return;
   }
-  static const llvm::StringSet<> CapturingMethods{"insert", "push",
-                                                  "push_front", "push_back"};
+  static const llvm::StringSet<> CapturingMethods{
+      "insert", "insert_or_assign", "push", "push_front", "push_back"};
   if (!CapturingMethods.contains(MD->getName()))
     return;
   Annotate(MD);

@usx95 usx95 merged commit 5e9e1ff into llvm:main Jan 8, 2025
11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 8, 2025

LLVM Buildbot has detected a new failure on builder llvm-x86_64-debian-dylib running on gribozavr4 while building clang at step 6 "test-build-unified-tree-check-clang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/16507

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-clang) failure: test (failure)
******************** TEST 'Clang :: SemaOpenACC/update-construct-ast.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /b/1/llvm-x86_64-debian-dylib/build/bin/clang -cc1 -internal-isystem /b/1/llvm-x86_64-debian-dylib/build/lib/clang/20/include -nostdsysteminc /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/SemaOpenACC/update-construct-ast.cpp -fopenacc -ast-dump | /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/SemaOpenACC/update-construct-ast.cpp
+ /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/SemaOpenACC/update-construct-ast.cpp
+ /b/1/llvm-x86_64-debian-dylib/build/bin/clang -cc1 -internal-isystem /b/1/llvm-x86_64-debian-dylib/build/lib/clang/20/include -nostdsysteminc /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/SemaOpenACC/update-construct-ast.cpp -fopenacc -ast-dump
RUN: at line 4: /b/1/llvm-x86_64-debian-dylib/build/bin/clang -cc1 -internal-isystem /b/1/llvm-x86_64-debian-dylib/build/lib/clang/20/include -nostdsysteminc /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/SemaOpenACC/update-construct-ast.cpp -fopenacc -emit-pch -o /b/1/llvm-x86_64-debian-dylib/build/tools/clang/test/SemaOpenACC/Output/update-construct-ast.cpp.tmp /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/SemaOpenACC/update-construct-ast.cpp
+ /b/1/llvm-x86_64-debian-dylib/build/bin/clang -cc1 -internal-isystem /b/1/llvm-x86_64-debian-dylib/build/lib/clang/20/include -nostdsysteminc /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/SemaOpenACC/update-construct-ast.cpp -fopenacc -emit-pch -o /b/1/llvm-x86_64-debian-dylib/build/tools/clang/test/SemaOpenACC/Output/update-construct-ast.cpp.tmp /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/SemaOpenACC/update-construct-ast.cpp
RUN: at line 5: /b/1/llvm-x86_64-debian-dylib/build/bin/clang -cc1 -internal-isystem /b/1/llvm-x86_64-debian-dylib/build/lib/clang/20/include -nostdsysteminc /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/SemaOpenACC/update-construct-ast.cpp -fopenacc -include-pch /b/1/llvm-x86_64-debian-dylib/build/tools/clang/test/SemaOpenACC/Output/update-construct-ast.cpp.tmp -ast-dump-all | /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/SemaOpenACC/update-construct-ast.cpp
+ /b/1/llvm-x86_64-debian-dylib/build/bin/clang -cc1 -internal-isystem /b/1/llvm-x86_64-debian-dylib/build/lib/clang/20/include -nostdsysteminc /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/SemaOpenACC/update-construct-ast.cpp -fopenacc -include-pch /b/1/llvm-x86_64-debian-dylib/build/tools/clang/test/SemaOpenACC/Output/update-construct-ast.cpp.tmp -ast-dump-all
+ /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/SemaOpenACC/update-construct-ast.cpp
/b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/SemaOpenACC/update-construct-ast.cpp:256:17: error: CHECK-NEXT: is not on the line after the previous match
 // CHECK-NEXT: IntegerLiteral{{.*}}1
                ^
<stdin>:226:5: note: 'next' match was here
| `-IntegerLiteral 0x7cc5d0 <col:72> 'int' 1
    ^
<stdin>:224:135: note: previous match ended here
| | `-DeclRefExpr 0x7d3f08 <col:59> 'decltype(SomeStruct::value)[5]' lvalue Var 0x7d3c90 'LocalArray' 'decltype(SomeStruct::value)[5]'
                                                                                                                                      ^
<stdin>:225:1: note: non-matching line after previous match is here
| |-IntegerLiteral 0x7cc5f0 <col:70> 'int' 0
^

Input file: <stdin>
Check file: /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/SemaOpenACC/update-construct-ast.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          .
          .
          .
        221: | | `-IntegerLiteral 0x7cc8c0 <col:55> 'int' 0 
        222: | `-ArraySectionExpr 0x7d3f40 <col:59, col:73> '<array section type>' lvalue 
        223: | |-ImplicitCastExpr 0x7d3f28 <col:59> 'decltype(SomeStruct::value) *' <ArrayToPointerDecay> 
        224: | | `-DeclRefExpr 0x7d3f08 <col:59> 'decltype(SomeStruct::value)[5]' lvalue Var 0x7d3c90 'LocalArray' 'decltype(SomeStruct::value)[5]' 
        225: | |-IntegerLiteral 0x7cc5f0 <col:70> 'int' 0 
        226: | `-IntegerLiteral 0x7cc5d0 <col:72> 'int' 1 
next:256         !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  error: match on wrong line
        227: |-CXXRecordDecl 0x7cc270 <line:259:1, line:262:1> line:259:8 imported referenced <undeserialized declarations> struct SomeStruct definition 
        228: | |-DefinitionData pass_in_registers empty aggregate standard_layout trivially_copyable pod trivial literal has_constexpr_non_copy_move_ctor can_const_default_init 
        229: | | |-DefaultConstructor exists trivial constexpr needs_implicit defaulted_is_constexpr 
        230: | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param 
        231: | | |-MoveConstructor exists simple trivial needs_implicit 
          .
          .
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants